package com.huey.utils.fx;

/**
 * @author huey
 */
public class WebResult {
    public static final String OK = "0";
    public static final Integer CREATEED = 0;
    public static final Integer NOT_MODIFY = 0;
    public static final Integer UNAUTHORIZED = 401;
    public static final Integer UNAUTHORIZED_NOTOKEN = 4011;
    public static final Integer UNAUTHORIZED_ERROR = 4012;
    public static final Integer UNAUTHORIZED_EXPIRE = 4013;
    public static final Integer UNAUTHORIZED_NO_CONSIST = 4014;
    public static final Integer NOT_FOUND = 404;
    public static final Integer INVALID_REQUST = 422;
    public static final Integer SYS_ERROR = 500;

    public static final WebResult SUCCESS_OK = new WebResult(null, OK, "success");

    private Object data;

    private String code;

    private String message;

    public WebResult() {
    }

    public WebResult(Object data, String code) {
        this.data = data;
        this.code = code;
    }

    public WebResult(Object data, String code, String message) {
        this.data = data;
        this.code = code;
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public String toString() {
        return "WebResult [data=" + data + ", code=" + code + "]";
    }
}
